package com.tancire.common.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

public class TcrDateUtils {

    /**
     * 格式化日志字符串
     *
     * @param date
     * @return
     */
    public static String getDayStr(Date date) {
        if (null == date) {
            date = new Date();
        }
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        return sdf.format(date);
    }

    /**
     * 获取当前年月日字符串
     *
     * @return
     */
    public static String getDayStr() {
        return getDayStr(new Date());
    }

}
